package com.itheima.array;

import java.util.Arrays;

public class BubooSort {

    public static void main(String[] args) {
        int[] arr={11,99,55,88,66,33,77,44,66};        bubboSort(arr);
        System.out.println(Arrays.toString(arr));
    }

    public static void bubboSort(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            int min=arr[i];
            for (int j = i; j < arr.length; j++) {
                if(min>arr[j]){
                     min=arr[j];
                    arr[j]=arr[i];
                    arr[i]=min;
                }
            }
        }

    }
}
